<script setup lang="ts">
defineProps<{ disableCancelButton?: boolean; disableOkButton?: boolean }>();

const emit = defineEmits(["ok", "cancel"]);
</script>

<template>
  <Dialog>
    <form @submit.prevent="emit('ok')">
      <div class="text-lg"><slot name="title">确定操作</slot></div>
      <div class="my-3 min-h-14"><slot></slot></div>
      <div class="flex justify-end items-center gap-x-2">
        <button
          class="border bg-cyan-600 text-white px-3 py-1.5 rounded border-cyan-600"
          v-if="!disableOkButton"
          type="submit"
        >
          确定
        </button>
        <button
          class="border bg-gray-200 px-3 py-1.5 rounded border-gray-300"
          v-if="!disableCancelButton"
          @click="emit('cancel')"
          type="button"
        >
          取消
        </button>
      </div>
    </form>
  </Dialog>
</template>
